﻿@using WebApp.Classes;
@using Models.Models;

@{
    var user = new UserCookie().Get().User;

    var domains = new WebApp.Services.DomainService().GetStoreIPList(new Store() { ID = user.StoreID }, 1, 1000000, "Name", "ASC", true).DomainList;
    var domainList = new SelectList(domains.List, "ID", "Name");        
    
    var groups = new List<KeyValuePair<string, string>>();
    groups.Add(new KeyValuePair<string, string>("6", "Yearly"));
    groups.Add(new KeyValuePair<string, string>("1", "Hourly"));
    groups.Add(new KeyValuePair<string, string>("2", "Daily"));
    groups.Add(new KeyValuePair<string, string>("3", "Weekly"));
    groups.Add(new KeyValuePair<string, string>("4", "Monthly"));
    groups.Add(new KeyValuePair<string, string>("5", "Quarterly"));
    
    var groupList = new SelectList(groups, "Key", "Value");
}

@Styles.Render("~/Content/themes/base/jquery.ui.all.css")
@Styles.Render("~/Content/themes/base/jquery.ui.datepicker.css")    

@Scripts.Render("~/scripts/jquery-ui-1.8.11.min.js")
@Scripts.Render("~/scripts/app/gchart.js")
@Scripts.Render("http://www.google.com/jsapi")

@Scripts.Render("~/scripts/app/" + Path.GetFileNameWithoutExtension(Server.MapPath(VirtualPath)) + ".js")

@Html.Hidden("userID", user.UserID)
@Html.Hidden("storeID", user.StoreID)

<form></form>
<table width="100%" border="0">
    <tr>
        <td valign="top" width="25%">
            Domain: 
            @Html.DropDownList("domainSelect", domainList, new { @class = "input-medium", @id = "domainSelect" })
        </td>
        <td valign="top" width="20%">
            Group By:
            @Html.DropDownList("groupSelect", groupList, new { @class = "input-small", @id = "groupSelect" })
        </td>
        <td valign="top" width="15%">
            from:
            <input type="text" class="datePicker start"/>
        </td>
        <td valign="top" width="15%">
            to:
            <input type="text" class="datePicker end"/>
        </td>
        <td valign="top" align="right">
            <button type="button" class="btn btn-inverse active" id="chart"><i class="icon-align-left icon-white"></i> Chart</button>
            <button type="button" class="btn btn-inverse" id="table"><i class="icon-list icon-white"></i> Table</button>
            <button type="button" class="btn btn-inverse" id="csv"><i class="icon-download icon-white"></i> CSV</button>
        </td>
    </tr>
</table>

<div id="divData" style="overflow: hidden">
</div>